<?php

declare(strict_types=1);

namespace DreamCat\StateMachine\Popo;

/**
 * 动作执行后置条件检查
 * @author vijay
 */
class ActionExecConditionFail
{
    /** @var int 失败的错误码 */
    private int $failCode;
    /** @var string 失败的原因描述 */
    private string $failText;

    /**
     * @return int 失败的错误码
     */
    public function getFailCode(): int
    {
        return $this->failCode;
    }

    /**
     * @param int $failCode 失败的错误码
     * @return ActionExecConditionFail
     */
    public function setFailCode(int $failCode): ActionExecConditionFail
    {
        $this->failCode = $failCode;
        return $this;
    }

    /**
     * @return string 失败的原因描述
     */
    public function getFailText(): string
    {
        return $this->failText;
    }

    /**
     * @param string $failText 失败的原因描述
     * @return ActionExecConditionFail
     */
    public function setFailText(string $failText): ActionExecConditionFail
    {
        $this->failText = $failText;
        return $this;
    }
}

# end of file
